package com.chem.lems.controller;

import com.chem.lems.serves.RecordServies;
import com.chem.lems.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/record")
public class RecordController {
    @Autowired
    private RecordServies recordServies;

    /**
     * 获取全部记录
     *
     * @return
     */
    @GetMapping()
    public ResultUtil gitRecordList() {

        return recordServies.gitRecordList();
    }

    /**
     * 获取用户的设备历史借用的记录
     *
     * @return
     */
    @GetMapping("{userId}")
    public ResultUtil gitRecordListByUserId(@PathVariable("userId") String userId) {

        return recordServies.gitRecordListByUserId(userId);
    }

    /**
     * 获取用户记录
     *
     * @return
     */
    @PostMapping()
    public ResultUtil gituserRecord() {

        return recordServies.gituserRecord();
    }

    /**
     * 设备增加统计
     *
     * @return
     */
    @GetMapping("/equipAdd")
    public ResultUtil gitEquipAddRecord() {
        return recordServies.gitEquipAddRecord();
    }

    /**
     * 设备使用统计
     *
     * @return
     */
    @GetMapping("/equipUse")
    public ResultUtil gitEquipUseRecord() {
        return recordServies.gitEquipUseRecord();
    }

    /**
     * 用户数量统计
     *
     * @return
     */
    @GetMapping("/user")
    public ResultUtil gituserNumbRecord() {
        return recordServies.gituserNumbRecord();
    }

}
